package models;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import play.data.validation.Required;
import play.db.jpa.Model;
/**
 * @author MrROY
 * 喜爱的文集
 */
@Entity
@Table(name="T_FAVORITE_STORY")
public class FavoriteStory extends Model{
	public String tag;
	@Required
	@ManyToOne
	public Story story;
	@Required
	@ManyToOne
	public User user;
	
	public FavoriteStory(){}
	public FavoriteStory(Long storyId,Long userId){
		this.story = Story.findById(storyId);
		this.user = User.findById(userId);
	}
}
